<template>
	<view class="container">
		<carHeader :title="'收支明细'" ></carHeader>
		<view class="rongqi">
			<view class="tixian">
				<view style="margin-left: 90rpx;font-size: 40rpx;">{{wdcurrentBalance}}</view>
				<view style="margin-left: 30rpx;">当前现金余额 (元)</view>
				<view>
					<button class="anniu" @click="tx">
						提现
					</button>
				</view>
			</view>

			<view class="zojie">
				<view class="">
					累计收入 (元) : {{leijishouri}}元
				</view>

				<view class="" style="margin-top: 20rpx;">
					累计提现 (元) : {{leijitixian}}元
				</view>
			</view>
		</view>

		<!-- 详细账单 -->



		<view class="zhangdan">
			<view class="biaoti" style="margin-left: 30rpx;">
				收支明细
			</view>
			<block v-for="(item, index) in items" :key="index">
				<view class="neirong">
					<view class="">
						<view style="font-size: 30rpx;font-weight: 600;">
							{{ item.carServiceDetail1.proName}}
						</view>
						<view style="font-size: 25rpx;font-weight: 100;">
							核销时间:{{ item.verificationTime }}
						</view>
					</view>
					<view style="color: red;font-size: 30rpx;font-weight: 550;">
						{{ '+'+item.ordactualPrice }}
					</view>
				</view>
			</block>
			<block v-for="(item, index) in items1" :key="index">
				<view class="neirong">
					<view class="">
						<view style="font-size: 30rpx;font-weight: 600;">
							提现
						</view>
						<view style="font-size: 25rpx;font-weight: 100;">
							提现时间:{{ item.wdwithdrawalRecord }}
						</view>
					</view>
					<view style="color: red;font-size: 30rpx;font-weight: 550;">
						{{ '-'+item.wdcashWithdrawal }}
					</view>
				</view>
			</block>
		</view>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				wdcurrentBalance:'',
				leijishouri:'',
				leijitixian:'',
				items: [{
						title: '',
						time: '',
						amount: ''
					}
				],
				items1: [{
						title: '',
						time: '',
						amount: ''
					}
				]
			}
		},
		onShow() {
						    console.log("页面加载...");
						    var that = this;
						    uni.request({
						      url: 'http://localhost:8080/carShopService/consume',
						      method: "GET",
						data:{
							
						},
						      success:function(res){
						        console.log(res.data);
						        that.wdcurrentBalance=res.data.data.wdcurrentBalance;
						        that.items1=res.data.data;
						        console.log(that.wdcurrentBalance)
						      }
						    })
						// 累计收入
						   uni.request({
						      url: 'http://localhost:8080/carShopService/consume/count',
						      method: "GET",
						data:{
							
						},
						      success:function(res){
						        console.log(res.data);
						       that.leijishouri=res.data.data;
						      }
						    })
						// 累计题现金额
						   uni.request({
						      url: 'http://localhost:8080/carShopService/consume/counttixian',
						      method: "GET",
						data:{
							
						},
						      success:function(res){
						        console.log(res.data);
						       that.leijitixian=res.data.data;
						      }
						    })
						//根据商户ID查询收入订单
						uni.request({
						      url: 'http://localhost:8080/carShopService/consume/list1',
						      method: "GET",
						data:{
							
						},
						      success:function(res){
						        console.log(res.data);
						          that.items=res.data.rows
						   
						      }
						    }),
						uni.request({
						      url: 'http://localhost:8080/carShopService/consume/list2',
						      method: "GET",
						data:{
							
						},
						      success:function(res){
						        console.log(res.data);
						          that.items1=res.data.rows
						   
						      }
						    })
						  },
		methods: {
		
			
			tx() {
				uni.navigateTo({
					url: "/pages/application/application",
					
				})
			}
		}
	}
</script>

<style>
	.container {
		position: relative;
		/* 添加此行 */
	}

	.rongqi {
		display: flex;
		position: absolute;
		/* 添加此行 */
		top: -2rpx;
		/* 根据需要调整数值 */
		left: 20rpx;
		width: 700rpx;
	}

	.tixian {
		margin-left: 30rpx;
		width: 46%;
		border-right: 2rpx solid yellow;
		margin-top: 100rpx;
		color: azure;
	}

	.anniu {
		width: 270rpx;
		border-radius: 90rpx;
		height: 70rpx;
		background-color: red;
		color: white;
		margin-top: 20rpx;
		margin-left: 10rpx;
		line-height: 180%
	}

	.zojie {
		margin-left: 60rpx;
		margin-top: 150rpx;
		color: white;
	}

	/* 收支明细账单 */
	.zhangdan {
		width: 92%;

		margin-left: 4%;
		background-color: white;
		position: relative;
		/* 添加定位 */
		top: -25rpx;
		border-radius: 30rpx;
	}

	.biaoti {
		height: 90rpx;
		border-bottom: 5rpx solid #d0eeec;
		display: flex;
		align-items: center;
		font-size: 35rpx;
		font-weight: 700;
	}

	.neirong {
		display: flex;
		justify-content: space-around;
		align-items: center;
		height: 130rpx;
		border-bottom: 3rpx solid #eee;
	}

</style>